/*
 * @Date: 2024-04-02 16:05:22
 * @LastEditors: bingkui.wu
 * @LastEditTime: 2024-04-02 16:06:16
 * @Description: 通过 categoryId 获取 年级信息
 */
import { REQUEST } from "#type/request";
import Response from "@common/Response";
import { BookGrade } from "@models/BookGrade";

const root: REQUEST.BASIC = {
    auth: false,
    method: "get",
    request: async (ctx: any) => {
        const { categoryId } = ctx.request.query;
        const list = await BookGrade.find({categoryId}).lean().exec();
        return Response.Success(list);
    },
};

export default root;
